package com.moleq.test;

import java.util.Timer;
import java.util.TimerTask;

public class MyTimer {
	private Tick mTask = null;

	public MyTimer() {
		Timer timer = new Timer();
		this.mTask = new Tick();
		timer.schedule(this.mTask, 0, 1000);

	}

	public int getTick() {
		return this.mTask.getTicks();
	}

	static class Tick extends TimerTask {

		private int mTick = 0;

		public Tick() {
			this.mTick = 0;

		}

		public int getTicks() {
			return this.mTick;

		}

		@Override
		public void run() {
			this.mTick += 1;

		}

	}
}
